package com.linkhub.oms.admin.modules.user.account.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.linkhub.oms.admin.modules.user.account.domain.dto.UserAccountDTO;
import com.linkhub.oms.admin.modules.user.account.domain.vo.UserAccountVO;
import com.linkhub.oms.common.enums.mp.TransactionTypeEnum;
import com.linkhub.oms.entity.UserAccountEntity;

import java.math.BigDecimal;

/**
 * <p>
 * 用户账户表 服务类
 * </p>
 *
 * @author Frank
 * @since 2024-05-26
 */
public interface IUserAccountService extends IService<UserAccountEntity> {
    /**
     * 查询用户账户
     *
     * @param userId userId
     * @return UserAccountVO
     */
    UserAccountVO getUserAccount(String userId);

    void reduceTotalBalance(String userId, BigDecimal expense);



    /**
     * 变更账户金额
     *
     * @param userId              userId
     * @param operateAmount       本次变更金额
     * @param transactionTypeEnum 金额对应的交易类型
     * @return 变更后的账户
     */
    UserAccountDTO updateAccountAmount(String userId, BigDecimal operateAmount, TransactionTypeEnum transactionTypeEnum);
}
